A variety of recording media including magnetic disks and optical discs are recently used to store digital data, such as still images, music content, and video data. Among such recording media, memory cards that mainly use nonvolatile memories like NAND-type flash memories as their recording elements are compact, and thus have been widely used in compact portable devices, such as digital still cameras, mobile telephone terminals, and video cameras.
A NAND-type flash memory can be written in units of pages (for example, in units of 512 bytes, 2 kilobytes, or 8 kilobytes). Before such writing, the NAND-type flash memory needs to be in erased state in units of blocks (for example, in units of 512 kilobytes or 1 megabyte) each consisting of a plurality of pages. More specifically, the NAND-type flash memory has the write characteristics described below. The NAND-type flash memory allows, like a magnetic disk, data to be written directly in units of pages into its erased blocks in which no data has ever been written. However, to enable data to be written into pages in which data has once been written, the NAND-type flash memory requires the recorded data to be erased in units of blocks to generate erased blocks, and then allows the new data to be written into the generated erased blocks in units of pages.
When an access device, such as a digital still camera, writes data to a nonvolatile storage device that uses a NAND-type flash memory, the nonvolatile storage device, in which data can be written only in erased blocks of the NAND-type flash memory, is required to perform the internal processing of first searching for an erased block to which data is to be written. When detecting an erased block as a result of searching, the nonvolatile storage device writes data received from the access device into the detected erased block in units of pages. When detecting no erased block, the nonvolatile storage device performs the processing described below:
(1) The nonvolatile storage device generates an erased block by erasing a physical block from which data has yet to be erased but that is unused because for example the latest data has been already copied to another block.
(2) The nonvolatile storage device then writes data received from the access device into the generated erased block in units of pages.
The above data writing performed by the nonvolatile storage device requires a longer processing time than data writing performed by other storage media, such as a dynamic random access memory (DRAM). Further, when the access device writes data less than the size of a single block, the nonvolatile storage device may need to read data from the previously recorded other physical block and copy the read data into the newly generated erased block. Such data writing performed by the nonvolatile storage device requires a longer processing time than normal writing.
To solve the above problem, a technique (a conventional nonvolatile storage device) described in, for example, Patent Literature 1 improves the data writing speed.